{
char *key = NULL;
struct role_datum *role;
- int rc, to_read = 2;
+ int rc;
__le32 buf[3];
u32 len;
memset(role, 0, sizeof(*role));
if ( p->policyvers >= POLICYDB_VERSION_BOUNDARY )
- to_read = 3;
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+ else
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
- rc = next_entry(buf, fp, sizeof(buf[0]) * to_read);
if ( rc < 0 )
goto bad;
{
char *key = NULL;
struct type_datum *typdatum;
- int rc, to_read = 3;
+ int rc;
__le32 buf[4];
u32 len;
memset(typdatum, 0, sizeof(*typdatum));
if ( p->policyvers >= POLICYDB_VERSION_BOUNDARY )
- to_read = 4;
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
+ else
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
- rc = next_entry(buf, fp, sizeof(buf[0]) * to_read);
if ( rc < 0 )
goto bad;
{
char *key = NULL;
struct user_datum *usrdatum;
- int rc, to_read = 2;
+ int rc;
__le32 buf[3];
u32 len;
memset(usrdatum, 0, sizeof(*usrdatum));
if ( p->policyvers >= POLICYDB_VERSION_BOUNDARY )
- to_read = 3;
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+ else
+ rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
- rc = next_entry(buf, fp, sizeof(buf[0]) * to_read);
if ( rc < 0 )
goto bad;